home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / Tetris / Source / RCS / Piece.h,v < prev    next >
Encoding:
Text File  |  1972-08-29  |  2.8 KB  |  200 lines

  1. head     1.7;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.7
  10. date     92.03.01.05.07.33;  author melling;  state Exp;
  11. branches ;
  12. next     1.6;
  13.  
  14. 1.6
  15. date     92.02.29.20.35.41;  author melling;  state Exp;
  16. branches ;
  17. next     1.5;
  18.  
  19. 1.5
  20. date     92.02.28.05.18.51;  author melling;  state Exp;
  21. branches ;
  22. next     1.4;
  23.  
  24. 1.4
  25. date     91.12.19.10.12.35;  author melling;  state Exp;
  26. branches ;
  27. next     1.3;
  28.  
  29. 1.3
  30. date     91.12.16.17.22.01;  author melling;  state Exp;
  31. branches ;
  32. next     1.2;
  33.  
  34. 1.2
  35. date     91.12.07.07.48.58;  author melling;  state Exp;
  36. branches ;
  37. next     1.1;
  38.  
  39. 1.1
  40. date     91.12.07.03.36.51;  author melling;  state Exp;
  41. branches ;
  42. next     ;
  43.  
  44.  
  45. desc
  46. @Tetris 1.1
  47. @
  48.  
  49.  
  50. 1.7
  51. log
  52. @*** empty log message ***
  53. @
  54. text
  55. @
  56. #import <objc/Object.h>
  57.  
  58. #define MAX_SHAPE_SIZE    4
  59. #define PIECE_INFO_NULL    (struct pieceInfo *)0
  60. #define NUM_BITMAPS    4
  61.  
  62. struct shape {
  63.     unsigned char table[4][4];
  64.     unsigned char bounds[4];
  65.     unsigned char points[4];
  66. };
  67.  
  68. struct pieceInfo {
  69.     id bitmap;
  70.     int shape;
  71.     int rotation;
  72. };
  73.  
  74. @@interface Piece:Object
  75. {
  76.     int curRow, curCol;              // The Block's position
  77.     id bitmap;                          // The image used to build the block
  78.     unsigned char *currentPiece;
  79.     struct shape *currentShape;
  80.     int shapenum;                      // The Shape that we are currently dropping
  81.     int currentRotation;
  82.     int dropPoints;                  // Bonus points for dropping the piece
  83.     NXSize blockSize;
  84.     NXSize intercell;
  85.     NXRect invalidRect;
  86.  
  87.     BOOL viewVarsInited;
  88.     id anmShape;
  89.     id anmBackground;              // The animation background
  90.     struct shape shapes[7];
  91.      id blockImage[NUM_BITMAPS]; // Holds the id for each block image.
  92. }
  93.  
  94. - init;
  95.  
  96. - draw:sender;
  97. - (BOOL)reset:sender piece:(struct pieceInfo *)info;
  98. - newPiece;
  99. - (struct pieceInfo *)pieceInfo;
  100. - setPiece:(struct pieceInfo *)info;
  101.  
  102. - (BOOL)legalMove:sender :(int)row :(int)column rotation:(int)rotation;
  103.  
  104. - left:sender;
  105. - right:sender;
  106.  
  107. - getInvalidRect:(NXRect *)aRect for:sender;
  108. - point:(NXPoint *)thePoint for:(int)row :(int)column;
  109. - (int)points;
  110. - getBlockSize:(NXSize *) size;
  111. - getBlockImage:(int) blockNum;
  112.  
  113. - drop:sender;
  114. - (BOOL)down:sender;
  115. - turn:sender;
  116. - stick:sender;
  117.  
  118. - (int)getCurRow;
  119.  
  120. - free;
  121.  
  122. @@end
  123. @
  124.  
  125.  
  126. 1.6
  127. log
  128. @*** empty log message ***
  129. @
  130. text
  131. @d57 1
  132. @
  133.  
  134.  
  135. 1.5
  136. log
  137. @*** empty log message ***
  138. @
  139. text
  140. @d29 1
  141. a29 1
  142.     NXSize bitmapSize;
  143. d56 1
  144. @
  145.  
  146.  
  147. 1.4
  148. log
  149. @*** empty log message ***
  150. @
  151. text
  152. @d6 1
  153. d37 1
  154. @
  155.  
  156.  
  157. 1.3
  158. log
  159. @*** empty log message ***
  160. @
  161. text
  162. @a22 1
  163.      id aCheater;                      // The Cheater Object
  164. a35 1
  165.      BOOL cheating;                  // Determine the next piece from a Panel
  166. @
  167.  
  168.  
  169. 1.2
  170. log
  171. @Tetris 1.2
  172. @
  173. text
  174. @d21 3
  175. a23 2
  176.     int x, y;
  177.     id bitmap;
  178. d28 1
  179. a28 1
  180.     int dropPoints;
  181. d35 1
  182. a35 1
  183.     id anmBackground;
  184. d37 1
  185. d62 1
  186. a62 1
  187. - (int)y;
  188. @
  189.  
  190.  
  191. 1.1
  192. log
  193. @Initial revision
  194. @
  195. text
  196. @d25 1
  197. a25 1
  198.     int shapenum;
  199. @
  200.